import { Entity, PrimaryGeneratedColumn } from "typeorm";
import { Code, Digdit, DateTime, CreateDate, UpdateDate, Text, Int } from "../utils";

/**
 * 红包活动表
 */
@Entity({ name: 'ks_red_packet' })
export class KsRedPacket {
    @PrimaryGeneratedColumn()
    id: number;
    /**
     * 类型
     */
    @Code({
        comment: `类型`
    })
    type: string;

    @Digdit({
        comment: '大小',
        default: 0
    })
    count: number;

    @Digdit({
        comment: '总数',
        default: 0
    })
    total: number;

    @Code({
        comment: '口令',
        default: ''
    })
    password: string;
    /**
     * 参加了才知道
     */
    @DateTime({ comment: '开奖时间', nullable: true })
    open_time: Date;

    @CreateDate()
    create_date: Date;

    @UpdateDate()
    update_date: Date;

    @Text({ comment: '文字描述', default: '' })
    text: string;

    @Int(11, { default: 0 })
    room_id: number;
}
